
/*
 * \class getVacinityEvents
 * \brief This class handles the distance calculation on the map
 * \author Salman Noor
 * \author Mahlatse Maraba
 */


var distanceVariable = 50;
$( "#distanceSlider" ).slider({
    value:50,
    min: 0,
    max: 150,
    step: 1,
    slide: function( event, ui ) {
        distanceVariable  = ui.value;
        $( "#distanceVariable" ).html( ui.value+" km" );

    },
    stop: function(event, ui) {
        getFilteredMarkersByDistance(distanceVariable);
        filterEvents();
    }

});
     
             
$( "#distanceVariable" ).html( $( "#distanceSlider" ).slider( "value" )+ " km" );
if (coordinateFinder.userLat != null && coordinateFinder.userLong !=null)
{
    $( "#distanceSlider").slider({
        disabled: false
    });
    getFilteredMarkersByDistance( distanceVariable );
}
else
{
    $( "#distanceSlider").slider({
        disabled: true
    });
}
 